From: Georges Basile Stavracas Neto Date: Thu, 12 Sep 2019 18:45:04 +0000 (-0300) Subject: lookingGlass: Only update window list when visible X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~811^2^2~84 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=43b4f2c7d5f975ca6589970f284f5eb7d4ed45db;p=gnome-shell.git lookingGlass: Only update window list when visible Updating the window list in the Looking Glass is a costly operation: it destroys a whole lot of actors, and recreates them. This triggers CSS changes, repaints, and allocations. It is specially bad when paired with Wayland's big number of window creations and deletions when showing Builder's and Epiphany's popup window. Only update the window list in the Looking Glass when it is visible. Related: https://gitlab.gnome.org/GNOME/mutter/issues/556 https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/719 --- diff --git a/js/ui/lookingGlass.js b/js/ui/lookingGlass.js index 9f692f4aa..0317973e8 100644 --- a/js/ui/lookingGlass.js +++ b/js/ui/lookingGlass.js @@ -304,6 +304,9 @@ var WindowList = class WindowList { } _updateWindowList() { + if (!this._lookingGlass.isOpen) + return; + this.actor.destroy_all_children(); let windows = global.get_window_actors(); let tracker = Shell.WindowTracker.get_default(); @@ -335,6 +338,10 @@ var WindowList = class WindowList { } } } + + update() { + this._updateWindowList(); + } }; Signals.addSignalMethods(WindowList.prototype); @@ -1099,6 +1106,8 @@ var LookingGlass = class LookingGlass { duration, mode: Clutter.AnimationMode.EASE_OUT_QUAD }); + + this._windowList.update(); } close() { @@ -1124,5 +1133,9 @@ var LookingGlass = class LookingGlass { onComplete: () => this.actor.hide() }); } + + get isOpen() { + return this._open; + } }; Signals.addSignalMethods(LookingGlass.prototype);